package com.zwps.common.minio.config;

import io.minio.*;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@AllArgsConstructor
public class MinioConfig {

    MinioConfigProperties minIoConfig;

    @Bean
    public MinioClient getMinIoClient() {
        return MinioClient.builder().endpoint(minIoConfig.getUrl())
                .credentials(minIoConfig.getAccessKey(), minIoConfig.getSecretKey()).build();
    }

}
